/**
 * @description 批量注册组件
 */
// const eleImports = import.meta.globEager('./components/**/*.vue')
// const customImports = import.meta.globEager('./custom/**/*.vue')
const eleImports = import.meta.glob('./components/**/*.vue', { eager: true })
const customImports = import.meta.glob('./custom/**/*.vue', { eager: true })
import './ele-reset.scss'
export default {
  install(app) {
    const imports = { ...eleImports, ...customImports }
    for (const key in imports) {
      const component = imports[key]
      const name = key
        .replace('./components/', '')
        .replace('./custom/', '')
        .replace('/index.vue', '')
      const prefix = 'Uc'
      const comName = prefix + name
      app.component(comName, component.default)
    }
  }
}
